package com.eunion.web.cms.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.eunion.web.cms.entity.StudentVolunteer;
import com.eunion.web.cms.service.StudentVolunteerService;
import com.eunion.web.common.base.BaseService;
import com.eunion.web.common.base.BaseTableCommonController;

/**
 * 考生志愿
 */
@Controller
@RequestMapping("/api/volunteer")
@PreAuthorize("hasAuthority('volunteer:admin')")
public class StudentVolunteerResource extends BaseTableCommonController<StudentVolunteer, Long> {

    @Autowired
    private StudentVolunteerService studentVolunteerService;

    @Override
    protected BaseService<StudentVolunteer, Long> getBaseService() {
        return studentVolunteerService;
    }

    /**
     * 进入考生志愿查询页面
     * @return
     */
    @RequestMapping("/index")
    public String index() {
        return getUrlBase();
    }

    @Override
    protected String getUrlBase() {
        return "admin/volunteer/volunteer";
    }
}
